<?php
/**
 *
 *  
 * Date: 2024/1/12
 * Email: < >
 */


namespace process;

use app\api\controller\GameCarController;
use Workerman\Crontab\Crontab;


class GameCarTask
{
    public function onWorkerStart()
    {
        // 每5分钟添加一场北京赛车游戏
        new Crontab('0 */5 * * * *', function () {
            $GameCarController = new GameCarController();
            $GameCarController->add();
            sleep(290);
            $GameCarController->openGame();
        });
//        new Crontab('0 */19 * * * *', function () {
//            $GameCarController = new GameCarController();
//            $GameCarController->openGame();
//        });

    }
}